import request from "./request/index.js";

export async function uploadImage(file) {
    try {
        const formData = new FormData();
        formData.append("file", file);

        const response = await request.post("/file/image", formData, {
            headers: {
                "Content-Type": "multipart/form-data",
            },
        });
        return response.data;
    } catch (error) {
        console.error(error);
        return Promise.reject(err)
    }
}